var input = document.getElementById('input')
var box = document.getElementById('box')
var incomplete = [], completed = []
input.onkeydown = function (e) {
    if (e.keyCode == 13) {
        if (!incomplete.includes(this.value)) {
            incomplete.push(this.value)
            var p = document.createElement('p')
            var ctx = document.createTextNode(this.value)
            p.appendChild(ctx)
            box.appendChild(p)
            for (let i = 0; i < box.children.length; i++) {
                box.children[i].onclick = function () {
                    box.removeChild(this)
                }
            }
            
        }else{
            alert('已在今日目标中啦😊')
        }
        this.value=''
    }
}